schemas: allow null as a valid FilterTopic entry#835
Open
m1lestones wants to merge 2 commits into
Open
Conversation
A null at a topic position in a filter means "match any topic at this
position", which is valid per the Ethereum JSON-RPC spec. The FilterTopic
schema only allowed bytes32 or an array of bytes32, causing validators to
reject filters like:
{"topics": ["0xABC...", null, ["0xDEF...", "0x123..."]]}
Closes ethereum#118
4 tasks
fjl
approved these changes
Jun 29, 2026
Contributor
|
I approved, but would be nice to add a test. |
Author
|
Added a test case in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the remaining open issue in #118.
A
nullentry at a topic position in a filter means "match any topic at this position" — this is valid per the Ethereum JSON-RPC spec and widely used in practice. For example:{ "topics": ["0xABC...", null, ["0xDEF...", "0x123..."]] }Position 0: match specific topic, position 1: match anything, position 2: match either of two topics.
However,
FilterTopiconly allowedbytes32or an array ofbytes32—nullwas not a valid entry, causing schema validators to reject otherwise valid filters.Change
Added
nullas a validoneOfoption in theFilterTopicschema insrc/schemas/filter.yaml.Test plan
make build && make test— all passingCloses #118